package com.ukao.cashregister.adapter;

import android.content.Context;

import com.mcxtzhang.commonadapter.rv.CommonAdapter;
import com.mcxtzhang.commonadapter.rv.ViewHolder;
import com.ukao.cashregister.R;
import com.ukao.cashregister.bean.QuiryDetailBean;
import com.ukao.cashregister.utils.MyDateUtils;

import java.util.List;

/**
 * Created by ukaodev on 2017/6/14.
 */

public class OperationStatusAdapter extends CommonAdapter<QuiryDetailBean.StatusListBean> {



    public OperationStatusAdapter(Context context, List<QuiryDetailBean.StatusListBean> datas) {
        super(context, datas, R.layout.opreration_item);
    }



    @Override
    public void convert(ViewHolder viewHolder, QuiryDetailBean.StatusListBean item) {

        if (viewHolder.getLayoutPosition() == 0) {
            viewHolder.setTextColorRes(R.id.operation_time, R.color.green);
            viewHolder.setTextColorRes(R.id.operation_status, R.color.green);
            viewHolder.setTextColorRes(R.id.operator, R.color.green);
        }else{
            viewHolder.setTextColorRes(R.id.operation_time, R.color.black);
            viewHolder.setTextColorRes(R.id.operation_status, R.color.black);
            viewHolder.setTextColorRes(R.id.operator, R.color.black);
        }
        viewHolder.setText(R.id.operation_time, MyDateUtils.formatDataTime(item.getCreateTime()));
        viewHolder.setText(R.id.operation_status, item.getStatusText());
        viewHolder.setText(R.id.operator, item.getWorkName());
    }













}
